package com.mmdccj.yugu.controller;

import com.github.pagehelper.PageInfo;
import com.mmdccj.yugu.common.Result;
import com.mmdccj.yugu.entity.SingerInfo;
import com.mmdccj.yugu.entity.User;
import com.mmdccj.yugu.service.SingerInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: MMDCCJ
 * @date: 2023-12-08 21:43
 */
@Slf4j
@RestController
@RequestMapping("/singerInfo")
public class SingerInfoController {
    @Autowired
    private SingerInfoService singerInfoService;

    @GetMapping("/getInfo")
    public Result<SingerInfo> getInfo(String userId) {
        return Result.success("成功", singerInfoService.getSingerInfo(userId));
    }

    @GetMapping("/randomSinger")
    public Result<PageInfo<User>> getInfo() {
        return Result.success("成功", singerInfoService.random());
    }
}
